package net.sdd.sms.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.sdd.common.result.Result;
import net.sdd.sms.service.SmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "短信发送")
@RestController
@RequestMapping("/sdd/sms")
@CrossOrigin
public class SmsController {
    @Autowired
    private SmsService smsService;

    @ApiOperation(value = "短信发送")
    @GetMapping("/{phone}")
    public Result sendSmsPhone(@PathVariable("phone") String phone){
        smsService.sendPhoneMessage(phone);
        return Result.ok();
    }
}